class_name WeaponStateAnim_AdditionalEffect_CheckCapacity
extends WeaponStateAnim_AdditionalEffect

#region 属性
@export var is_check_by_anim_finished:bool = true
@export var check_time:float = 0
var c_capacity:WeaponC_Capacity 
#endregion
#region 字段
#endregion
#region 信号
#endregion

#region 基类方法
func init_additional_effect(weapon_state:WeaponState):
	super.init_additional_effect(weapon_state)
	
func excute() -> Array[Util.AddCallMethodTrackRes]:
	super.excute()
	var reses:Array[Util.AddCallMethodTrackRes] = []
	if not weapon_state.anim_name:
		pass
	var anim:Animation = weapon_state.state_manager.get_animation(weapon_state.anim_name)
	if anim:
		var c_ex_method = weapon.get_component_by_name("WeaponC_ExtensionMethod")
		var method_name = c_ex_method.ex_method_dict.Common.method_names.check_capacity
		var bind_obj = c_ex_method.ex_method_dict.Common.object
		var t:float = -1 if is_check_by_anim_finished else clamp(check_time,time,anim.length)
		var res = Util.add_call_method_track_and_method(weapon.animation_player,weapon_state.anim_name,check_time,method_name,[weapon_state.anim_name,t],bind_obj)
		reses.append(res)
	return reses
#endregion
#region 公共方法
#endregion
#region 私有方法
#endregion
#region 生命周期函数
#endregion
